<template>
  <div class="box">
    <Head
      :title="`${this.$route.query.title}`"
      class="head rows-1"
      id="backstyle"
    >
    </Head>
    <div class="to">
      <!-- 文化背景区域 -->
    </div>
    <!-- 视频区域 -->
    <div class="video">
      <video-player
        style="height: 100%; margin: 0 auto; box-shadow: 5px 5px 8px #888888"
        class="video-player vjs-custom-skin"
        ref="videoPlayer"
        :playsinline="true"
        :options="playerOptions"
      ></video-player>
    </div>
    <div class="war">
      <div class="area-center">
        <!-- 歌词区域 -->
        <div class="context richText bold-size" v-html="text"></div>
      </div>
    </div>
  </div>
</template>

<script>
import { video } from "@/api/index";
import Head from "@/components/public/HeadPage.vue";
export default {
  data() {
    return {
      tex: "",
      playerOptions: {
        playbackRates: [0.7, 1.0, 1.5, 2.0],
        autoplay: false,
        muted: false,
        loop: false,
        preload: "auto",
        language: "zh-CN",
        aspectRatio: "16:9",
        fluid: true,
        sources: [
          {
            type: "video/mp4",
            src: "",
          },
        ],
        poster: "",

        notSupportedMessage: "此视频暂无法播放，请稍后再试",
        controlBar: {
          timeDivider: true,
          durationDisplay: true,
          remainingTimeDisplay: false,
          fullscreenToggle: true,
        },
      },
      list: [],
      text: "",
    };
  },
  mounted() {
    video(this.$route.query.id).then((res) => {
      if (res.data.code == 200) {
        // console.log(res.data.data);
        this.tex = res.data.data;
        this.list = res.data.data.videoUrl;
        this.text = res.data.data.videoContent;
        this.playerOptions.sources[0].src = `http://175.178.155.112:8080${this.list}`;
      }
    });
  },
  components: {
    Head,
  },
};
</script>

<style scoped>
.box {
  width: 100%;
  height: 6.5rem;
  background-color: #f0eff5;
}
.to {
  width: 100%;
  /* height:2rem; */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
}
/* 头标区域 */
.head {
  border-bottom: 2px solid #dad9df;
}
.xiao {
  width: 100%;
  display: flex;
  background-color: white;
}
/* 左边区域 */
.xiao .left {
  width: 5%;
  height: 100%;
  margin-left: 0.2rem;
}
.xiao .left img {
  width: 0.2rem;
  height: 0.2rem;
  margin-top: 0.03rem;
}
.zhong {
  padding-left: 0.1rem;
  line-height: 0.27rem;
  font-weight: 700;
}
h3 {
  width: 100%;
  height: 0.3rem;
  line-height: 0.3rem;
  text-align: center;
}
/* 视频区域  */
.video {
  width: 100%;
  height: 2rem;
}
.context {
  width: 100%;
  font-weight: 700;
  min-height: 0.5rem;
  text-indent: 0.3rem;
  margin-top: 0.15rem;
}
</style>